package com.xingxuecn.limit.service.impl;

import com.xingxuecn.limit.common.model.Page;
import com.xingxuecn.limit.common.model.ResultModel;
import com.xingxuecn.limit.common.model.User;
import com.xingxuecn.limit.dao.UserDao;
import com.xingxuecn.limit.dao.impl.UserDaoImpl;
import com.xingxuecn.limit.service.UserService;

import org.apache.struts2.ServletActionContext;

import java.sql.SQLException;
import java.util.List;

import javax.servlet.http.HttpSession;

/**
 * @author zgx at 2018/9/10 0010 下午 2:38
 */
public class UserServiceImpl implements UserService {
    private UserDao userDao = new UserDaoImpl();

    @Override
    public List<User> findAll() throws SQLException {
        return userDao.findAll();
    }

    @Override
    public List<User> search(User user) throws SQLException {
        return userDao.search(user);
    }

    @Override
    public Page searchPage(User user, Integer page, Integer rows) throws SQLException {
        return userDao.searchPage(user,page,rows);
    }

    @Override
    public int add(User user) throws SQLException {
        return userDao.add(user);
    }

    @Override
    public int update(User user) throws SQLException {
        return userDao.update(user);
    }

    @Override
    public int delete(Integer id) throws SQLException {
        return userDao.delete(id);
    }


}
